<template>
  <div>
    <el-card class="box-card">
      <div slot="header" class="clearfix">
        <h3>最新文章</h3>
      </div>
      <div v-for="(item,index) in newArticles" :key="item.id" class="text item">
        
       
        <div class="content">
          {{(index+1)+"、"+ item.title   }}
        </div>
        
      </div>
    </el-card>
  </div>
</template>

<script>
import {newArticle} from "@/api/article"
export default {
  data() {
    return {
      newArticles: [],
    };
  },
  created(){
    newArticle().then(res=>{
      this.newArticles=res.data
    })
  }
};
</script>

<style scoped lang="less">

/deep/.el-card__body {
    padding: 0;
    padding-left: 8px;
    padding-right: 8px;
    
}
.box-card {
  margin-top: 10px;
  border-radius: 10px;
  /* width: 300px; */

  
}
.clearfix {
  height: 30px;
  line-height: 0px;
}

.text {

  font-size: 14px;
}


.content{
  /* float: left; */
  font-size: 13px;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}
.clearfix:after {
  clear: both;
}


</style>